#include "01_TaskQueue.h"
#include "02_Producer.h"
#include "03_Consumer.h"

#include <thread>
using std::thread;
//#include <iostream>
//using std::cout;
//using std::endl;

void test(){
    // 1: 创建任务队列
    TaskQueue TQ(10);

    // 2: 创建对象
    Producer pro;
    Consumer con;

    // 3: 启动生产者线程
    thread producer_th(&Producer::Produce, &pro, std::ref(TQ));
    thread consumer_th(&Consumer::Consume, &con, std::ref(TQ));

    producer_th.join();
    consumer_th.join();
}

int main()
{
    test();
    return 0;
}

